package com.eudon.design_pattern.creational.singleton;

/**
 * @author eudon
 * @description 内部类单例模式
 * @date 2025/9/1
 * @email syd19970616@gmail.com
 * @address <a href="https://gitee.com/eudon">Gitee</a>
 */
public class InnerClassSingleton {
    private InnerClassSingleton() {
    }

    public static InnerClassSingleton getInstance() {
        return Holder.INSTANCE;
    }

    public static class Holder {
        private static final InnerClassSingleton INSTANCE;

        static {
            INSTANCE = new InnerClassSingleton();
        }
    }
}
